/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication1;

import java.io.File;
import java.io.FileFilter;

/**
 *
 * @author Oren
 */
public class FileLister {
    private File _currdir ;
    private File[] _filesarray;
    private File[] _dirarray ;

    private FileFilter _filesfilter = new FileFilter() {
        public boolean accept(File _currdir) {
            return _currdir.isFile();
        }
    };
    private FileFilter _dirfilter = new FileFilter() {
        public boolean accept(File _currdir) {
            return _currdir.isDirectory();
        }

    };

    public File[] getFiles () {return _filesarray;}
    public File[] getDir () {return _dirarray;}

    public FileLister(){
        _currdir = new File(".");
        _filesarray = _currdir.listFiles(_filesfilter);
        _dirarray = _currdir.listFiles(_dirfilter);
    }
}

